//package com.kungfuhacking.wristbandpro.find.presenter;
//
//import android.content.Context;
//import android.support.v7.widget.RecyclerView;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.TextView;
//
//import com.kungfuhacking.wristbandpro.R;
//import com.kungfuhacking.wristbandpro.find.bean.CardListEntity;
//import com.kungfuhacking.wristbandpro.find.bean.IdentityEntity;
//import com.kungfuhacking.wristbandpro.utils.DensityUtil;
//
//import java.util.List;
//
///**
// * Created by Aaron on 17/5/11.
// */
//
//public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.MyViewHolder> {
//
//    private Context context;
//    private List<CardListEntity> cardList;
//    //    private final static int RECHARGE_SUCCESS = 1;//已经支付给运营商,且运营商确认
////    private final static int RECHARGEING = -1;//未支付给运营商
////    private final static int RECHARGE_WAITING = 0;//已经支付给运营商,但是需要运营商确认
//    private IdentityEntity identity;
//    private static final int IS_HEADER = 2;
//    private static final int IS_NORMAL = 1;
//
//    public OrderDetailAdapter(Context ctx, List<CardListEntity> cardList) {
//        this.context = ctx;
//        this.cardList = cardList;
//    }
//
//    public void setCardList(List<CardListEntity> cardList) {
//        this.cardList = cardList;
//    }
//
//    public void setIdentity(IdentityEntity identity) {
//        this.identity = identity;
//    }
//
//    @Override
//    public OrderDetailAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//
//        switch (viewType) {
//
//            case IS_HEADER:
//                return new OrderDetailAdapter.MyViewHolder(
//                        LayoutInflater.from(context).inflate(R.layout.layout_orderinfo_head, parent,
//                                false), viewType);
//            case IS_NORMAL:
//                return new OrderDetailAdapter.MyViewHolder(
//                        LayoutInflater.from(context).inflate(R.layout.item_order_info, parent,
//                                false), viewType);
//        }
//
//        return null;
//
//    }
//
//    @Override
//    public void onBindViewHolder(OrderDetailAdapter.MyViewHolder viewHolder, int position) {
//
//        switch (getItemViewType(position)) {
//
//            case IS_HEADER:
//                if (identity != null) {
//
//                    viewHolder.tv_id_info.setTextSize(12);
//                    viewHolder.tv_id_info.setText(
//                            "手机号:" + identity.getPhoneNum()
//                                    + "\n姓名: " + identity.getIName()
//                                    + "\n身份证号: " + identity.getINo()
//                                    + "\n家庭住址: " + identity.getIAddress()
//                                    + "\n有效日期: " + identity.getITime()
////                        + "\n提交认证者: " + identity.getString("sendPeople")
////                        + "\n提交认证时间: " + identity.getString("addTime")
//                    );
//                }
//
//                break;
//
//            case IS_NORMAL:
//
//                --position;
//
//                viewHolder.tv_order_info.setTextSize(12);
//                viewHolder.tv_order_info.setPadding(DensityUtil.dip2px(context, 20), 0, DensityUtil.dip2px(context, 20), 0);
//
////        String recharge_status = "";
////        switch (cardList.get(position).getState()) {
////            case RECHARGE_SUCCESS:
////                recharge_status = "充值成功";
////                break;
////            case RECHARGEING:
////                recharge_status = "充值中";
////                break;
////            case RECHARGE_WAITING:
////                recharge_status = "充值中";
////                break;
////            default:
////                break;
////        }
//
//                viewHolder.tv_order_info.setText(
//                        "订单号:" + cardList.get(position).getTradeNo()
//                                + "\n充值手机号:" + cardList.get(position).getPhoneNum()
////                        +    "\n充值时间:" + CommonUtils.getLocalTime(o.getString("addTime")) +
//                                + "\n充值时间:" + cardList.get(position).getAddTime()
//                                + "\n充值套餐:" + cardList.get(position).getSubject()
////                            + "\n充值状态:" + recharge_status
//                );
//                break;
//
//        }
//
//    }
//
//    @Override
//    public int getItemViewType(int position) {
//
//        if (position == 0)
//            return IS_HEADER;
//        else
//            return IS_NORMAL;
//
//    }
//
//    @Override
//    public int getItemCount() {
//        return cardList.size() + 1;
//    }
//
//    class MyViewHolder extends RecyclerView.ViewHolder {
//
//        TextView tv_order_info;
//        TextView tv_id_info;
//
//        MyViewHolder(View view, int viewType) {
//            super(view);
//
//            switch (viewType) {
//
//                case IS_HEADER:
//                    tv_id_info = (TextView) view.findViewById(R.id.tv_id_info);
//                    break;
//
//                case IS_NORMAL:
//                    tv_order_info = (TextView) view.findViewById(R.id.tv_order_info);
//                    break;
//
//            }
//
//        }
//    }
//}
